package com.kk.io;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;

import java.io.File;
import java.io.FileReader;
import java.nio.charset.StandardCharsets;

public class IODemo {

    public static void main(String[] args) throws Exception {

        String path = System.getProperty("user.dir") + "/hutool/src/main/resource";
        String fileName = "template.xml";

        String content = IoUtil.read(new FileReader(path + File.separator + fileName));
        String replace = content.replace("${body}", "我是柯柯ta爹。小柯啊，窝嫩爹。");

        File file = FileUtil.writeString(replace, path + "/replace.xml", StandardCharsets.UTF_8);


    }

}
